package com.platform.admin.service;

import com.platform.admin.pojo.entity.SysPermission;
import com.platform.admin.pojo.req.CommonReq;
import com.platform.admin.pojo.req.SavePermissionReq;
import com.platform.admin.pojo.vo.SysPermissionVO;
import com.platform.admin.pojo.vo.SysServiceVO;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

@Api(tags = "系统授权服务接口")
public interface ISysPermissionService extends IService<SysPermission> {

    @ApiOperation(value = "刷新Redis缓存中角色菜单的权限规则，角色和菜单信息变更调用：初始化角色权限")
    boolean refreshPermRolesRules();

    List<SysPermission> listPermRoles();

    @ApiOperation(value = "获取权限列表")
    List<SysPermissionVO> listByMenuId(Long menuId);

    @ApiOperation(value = "新增权限")
    void createPermission(SavePermissionReq req);

    @ApiOperation(value = "更新权限")
    void updatePermission(SavePermissionReq req);

    @ApiOperation(value = "获取所有服务列表")
    List<SysServiceVO> getServices();

    @ApiOperation(value = "删除权限")
    void deletePermissions(List<Long> ids);

    @ApiOperation(value = "查询角色绑定的权限")
    List<Long> listRolePermission(Long roleId);

    @ApiOperation(value = "更新角色绑定的权限信息")
    void updateRolePermission(Long roleId, CommonReq req);
}
